#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
long long n = 0, x = 0;

int main()
{
	long long count = 0;
	cin >> x;
	long long tmp = 0;
	tmp = x;
	while (tmp)
	{
		tmp /= 10;
		n++;
	}
	int i = 1;
	for (int j = 0; j <= x; j++)
	{
		int a = pow(10, i);
		if (j / a != 0)
		{
			i++;
			j--;
			continue;
		}
		if (j / a == 0)
		{
			if (i % 2 == 0 && j % 2 == 0)
			{
				count++;
			}
			if (i % 2 == 1 && j % 2 == 1)
			{
				count++;

			}
		}
	}
	cout << count << endl;
	return 0;
}